package com.fly.container.controller;

import com.fly.container.service.SearchService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Mr.Fu
 * @date 2022/8/27 下午6:07
 */
@RestController
@RequestMapping(value = "search")
public class SearchController {

    @Resource
    private SearchService searchService;

    @GetMapping(path = "/{keyword}")
    public String search(@PathVariable String keyword) {
        return searchService.search(keyword);
    }

    @GetMapping(path = "/city/{cityId}")
    public String searchCity(@PathVariable String cityId) {
        return searchService.findCityName(cityId);
    }
}
